object DMDados: TDMDados
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Height = 520
  Width = 612
  object dsSAF0102_PRODUTOR: TDataSource
    DataSet = tblSAF0102_PRODUTOR
    Left = 176
    Top = 256
  end
  object dsSAF0103: TDataSource
    DataSet = tblSAF0103
    Left = 296
    Top = 256
  end
  object tblSAF0102_PRODUTOR: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    TableName = 'SAF0102'
    Left = 176
    Top = 200
  end
  object tblSAF0103: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    AfterOpen = tblSAF0103AfterOpen
    TableName = 'SAF0103'
    Left = 296
    Top = 200
  end
  object dsLista: TDataSource
    DataSet = qryLista
    Left = 64
    Top = 136
  end
  object dsTabela: TDataSource
    DataSet = tblTabela
    Left = 152
    Top = 136
  end
  object conADOServer: TADOConnection
    ConnectionString = 
      'Provider=SQLOLEDB.1;Password=safood@123;Persist Security Info=Tr' +
      'ue;User ID=sa;Initial Catalog=SAF;Data Source=127.0.0.1\SQLEXPRE' +
      'SS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4' +
      '096;Workstation ID=SAF-DESENV;Use Encryption for Data=False;Tag ' +
      'with column collation when possible=False'
    DefaultDatabase = 'SAF'
    LoginPrompt = False
    Mode = cmRead
    Provider = 'SQLOLEDB.1'
    Left = 64
    Top = 24
  end
  object tblTabela: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    AfterOpen = tblTabelaAfterOpen
    IndexFieldNames = 'ID_OC'
    TableName = 'SAF0501'
    Left = 152
    Top = 80
  end
  object qryLista: TADOQuery
    Connection = conADOServer
    CursorType = ctStatic
    AfterOpen = qryListaAfterOpen
    Parameters = <>
    SQL.Strings = (
      'SELECT'
      'SAF0501.ID_OE,'
      'SAF0501.ID_OC,'
      'SAF0301.ID_REF_OC_0,'
      'SAF0301.ID_PRODUTOR,'
      'SAF0102_PRODUTOR.FANTASIA AS ID_PRODUTOR_FANTASIA,'
      'SAF0301.EMBARQUE_SEMANA,'
      'SAF0301.EMBARQUE_SEMANA_LIMITE,'
      'SAF0301.ID_LOCAL_EMBARQUE,'
      'SAF0104_LOCAL_EMBARQUE.DESCRICAO_PT AS ID_LOCAL_EMBARQUE_DSC,'
      'SAF0301.ID_LOCAL_ENTREGA,'
      'SAF0104_LOCAL_ENTREGA.DESCRICAO_PT AS ID_LOCAL_ENTREGA_DSC,'
      'SAF0501.DATA,'
      'SAF0501.TARA_CAIXA,'
      'SAF0501.TOTAL_QTDE,'
      'SAF0501.TOTAL_PESO_LIQUIDO,'
      'SAF0501.TOTAL_SUB_QTDE,'
      'SAF0501.TOTAL_SUB_PESO_LIQUIDO,'
      'SAF0501.OE_VALIDA,'
      'SAF0501.OE_VALIDA_DATA,'
      'SAF0501.OE_VALIDA_ID_USUARIO,'
      'SAF0501.OE_TRANSMITE,'
      'SAF0501.OE_TRANSMITE_DATA,'
      'SAF0501.OE_TRANSMITE_ID_USUARIO,'
      'SAF0501.SIF_NRO,'
      'SAF0501.FLAG_REG'
      ''
      'FROM SAF0501'
      ''
      'LEFT JOIN SAF0301 ON (SAF0301.ID_OC = SAF0501.ID_OC)'
      
        'LEFT JOIN SAF0102 SAF0102_PRODUTOR ON (SAF0102_PRODUTOR.ID_CLIEN' +
        'TE = SAF0301.ID_PRODUTOR)'
      
        'LEFT JOIN SAF0104 SAF0104_LOCAL_EMBARQUE ON (SAF0104_LOCAL_EMBAR' +
        'QUE.ID_PORTO = SAF0301.ID_LOCAL_EMBARQUE)'
      
        'LEFT JOIN SAF0104 SAF0104_LOCAL_ENTREGA ON (SAF0104_LOCAL_ENTREG' +
        'A.ID_PORTO = SAF0301.ID_LOCAL_ENTREGA)'
      ''
      'WHERE'
      'SAF0501.FLAG_REG = 1')
    Left = 64
    Top = 80
  end
  object dsSAF0101: TDataSource
    DataSet = tblSAF0101
    Left = 64
    Top = 256
  end
  object tblSAF0101: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    IndexFieldNames = 'ID_EMPRESA'
    TableName = 'SAF0101'
    Left = 64
    Top = 200
  end
  object dsSAF0501A: TDataSource
    DataSet = tblSAF0501A
    Left = 232
    Top = 136
  end
  object tblSAF0501A: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    AfterOpen = tblSAF0501AAfterOpen
    IndexFieldNames = 'ID_OE'
    MasterFields = 'ID_OE'
    MasterSource = dsTabela
    TableName = 'SAF0501A'
    Left = 232
    Top = 80
    object tblSAF0501AID_OE_ITEM: TAutoIncField
      FieldName = 'ID_OE_ITEM'
      ReadOnly = True
    end
    object tblSAF0501AID_OE: TIntegerField
      FieldName = 'ID_OE'
    end
    object tblSAF0501ADATA: TDateTimeField
      FieldName = 'DATA'
    end
    object tblSAF0501ASEQUENCIA: TIntegerField
      FieldName = 'SEQUENCIA'
    end
    object tblSAF0501AID_PRODUTO: TIntegerField
      FieldName = 'ID_PRODUTO'
    end
    object tblSAF0501AID_PRODUTO_DSC_PT: TStringField
      FieldKind = fkLookup
      FieldName = 'ID_PRODUTO_DSC_PT'
      LookupDataSet = tblSAF0103
      LookupKeyFields = 'ID_PRODUTO'
      LookupResultField = 'DESCRICAO_PT'
      KeyFields = 'ID_PRODUTO'
      Size = 255
      Lookup = True
    end
    object tblSAF0501AID_PRODUTO_DSC_ING: TStringField
      FieldKind = fkLookup
      FieldName = 'ID_PRODUTO_DSC_ING'
      LookupDataSet = tblSAF0103
      LookupKeyFields = 'ID_PRODUTO'
      LookupResultField = 'DESCRICAO_ING'
      KeyFields = 'ID_PRODUTO'
      Size = 255
      Lookup = True
    end
    object tblSAF0501AQTDE: TIntegerField
      FieldName = 'QTDE'
    end
    object tblSAF0501APESO_LIQUIDO: TBCDField
      FieldName = 'PESO_LIQUIDO'
      Precision = 18
      Size = 2
    end
    object tblSAF0501APESO_BRUTO: TBCDField
      FieldName = 'PESO_BRUTO'
      Precision = 18
      Size = 2
    end
    object tblSAF0501AETIQUETA_CODIGO: TStringField
      FieldName = 'ETIQUETA_CODIGO'
      Size = 128
    end
    object tblSAF0501AETIQUETA_VIA: TIntegerField
      FieldName = 'ETIQUETA_VIA'
    end
    object tblSAF0501AFLAG_REG: TIntegerField
      FieldName = 'FLAG_REG'
    end
    object tblSAF0501ACHAVE_REG: TStringField
      FieldName = 'CHAVE_REG'
      Size = 255
    end
  end
  object dsSAF0301: TDataSource
    DataSet = tblSAF0301
    Left = 320
    Top = 136
  end
  object tblSAF0301: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    IndexFieldNames = 'ID_OC'
    TableName = 'SAF0301'
    Left = 320
    Top = 80
  end
  object qryAuxiliar: TADOQuery
    Connection = conADOServer
    Parameters = <>
    Left = 64
    Top = 320
  end
  object dspAuxiliar: TDataSetProvider
    DataSet = qryAuxiliar
    Options = [poAllowCommandText, poUseQuoteChar]
    Left = 152
    Top = 320
  end
  object cdsAuxiliar: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspAuxiliar'
    Left = 240
    Top = 320
  end
  object cdsAtualizaXML: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 408
    Top = 80
  end
  object dsAtualizaXML: TDataSource
    DataSet = cdsAtualizaXML
    Left = 488
    Top = 80
  end
  object cdsTempXML: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 408
    Top = 136
  end
  object dsTempXML: TDataSource
    DataSet = cdsTempXML
    Left = 488
    Top = 136
  end
  object qryTemp: TADOQuery
    Connection = conADOServer
    Parameters = <>
    Left = 64
    Top = 376
  end
  object dspTemp: TDataSetProvider
    DataSet = qryTemp
    Options = [poAllowCommandText, poUseQuoteChar]
    Left = 152
    Top = 376
  end
  object cdsTemp: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspTemp'
    Left = 240
    Top = 376
  end
  object dsTemp: TDataSource
    DataSet = tblTemp
    Left = 408
    Top = 256
  end
  object tblTemp: TADOTable
    Connection = conADOServer
    CursorType = ctStatic
    Left = 408
    Top = 200
  end
end
